<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=2.0">
<link href="${domain}/static/style/admin_style.css" rel="stylesheet" type="text/css">
<title>站点管理 - zhengqiang's blog</title>
</head>
<body>
	<jsp:include page="/WEB-INF/views/admin/include/header.jsp"><jsp:param name="curr" value="article" /></jsp:include>
	<div class="loc">
		<ul>
			<li><a href="${domain}/admin/">管理首页</a><span class="divider">/</span></li>
			<li><a href="${domain}/admin/article">文章管理</a><span class="divider">/</span></li>
			<li>新建</li>
		</ul>
	</div>
	<div class="main">
		<div class="form">
			<form action="${domain}/admin/article/add/save" method="post">
				<table>
					<tbody>
						<c:if test="${not empty messages}">
						<tr>
							<td colspan="2">
								<ul class="error">
								<c:forEach items="${messages}" var="message"><li>${message}</li></c:forEach>
								</ul>
							</td>
						</tr>
						</c:if>
						<tr>
							<th><label for="categoryId">分类：</label></th>
							<td>
								<select name="categoryId" id="categoryId" class="input" required="required">
								<c:forEach items="${categoryList}" var="category">
									<option value="${category.id}" <c:if test="${form.categoryId == category.id}">selected="selected"</c:if>>${category.name}</option>
								</c:forEach>
								</select>
							</td>
						</tr>
						<tr>
							<th><label for="title">标题：</label></th>
							<td>
								<input type="text" name="title" id="title" class="input" size="90" required="required" value="<c:out value="${form.title}" escapeXml="true" />" />
							</td>
						</tr>
						<tr>
							<th><label for="overview">概述：</label></th>
							<td>
								<textarea rows="8" cols="90" name="overview" id="overview" class="input" required="required" style="width: 90%;"><c:out value="${form.overview}" escapeXml="true" /></textarea>
							</td>
						</tr>
						<tr>
							<th><label for="content">正文：</label></th>
							<td>
								<textarea rows="40" cols="90" name="content" id="content" class="input" required="required" style="width: 90%;"><c:out value="${form.content}" escapeXml="true" /></textarea>
							</td>
						</tr>
						<tr>
							<th><label for="author">作者：</label></th>
							<td><input type="text" name="author" id="author" value="zhengqiang" class="input" required="required" /></td>
						</tr>
						<tr>
							<th><label for="">Tags：</label></th>
							<td></td>
						</tr>
						<tr>
							<td colspan="2">
								<input type="submit" class="btn btn_g" value="发布" />
								<input type="button" class="btn btn_w" value="放弃" />
							</td>
						</tr>
					</tbody>
				</table>
			</form>
		</div>
	</div>
</body>
</html>